package company.zuiyou;

import java.util.Scanner;

public class Z1 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        boolean positive = true;
        if (num.charAt(0) == '-') {
            positive = false;
            num = num.substring(1);
        }
        StringBuilder ans = new StringBuilder();
        int length = num.length();
        int next = 0;
        for (int i = length - 1; i >= 0; i--) {
            char c = num.charAt(i);
            int tmp = 0;
            if (c >= 'a' && c <= 'z')
                tmp = c - 'a' + 10 + next;
            else
                tmp = c - '0' + next;
            System.out.println(tmp);
            next = tmp / 10;
            ans.append(tmp - tmp / 10);
        }
        if (next != 0)
            ans.append(next);
        if (!positive)
            ans.append("-");
        System.out.println(ans);
    }
}
